<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<!--     
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="../js/vue.js"></script>
    <script src="https://unpkg.com/element-ui/lib/index.js"></script> -->

    <link rel="stylesheet" href="../element-ui/index.css">
    <script src="../js/vue.js"></script>
    <script src="../element-ui/index.js"></script>
    <style>
        *{padding: 0;margin: 0;}
        .row {
            margin-top: 10px;
        }
        .col{
            line-height: 40px;
            background-color: grey;
        }
    </style>
</head>

<body>
    <div id="app">
        <el-row class="row">
            <el-input v-model="input" clearable placeholder="请输入内容"></el-input>
            <p>input:{{input}}</p>
        </el-row>
        
        <el-row class="row">
            <el-input v-model="pwd" clearable show-password placeholder="请输入内容"></el-input>
            <p>pwd:{{pwd}}</p>
        </el-row>


        <el-row class="row">
            <el-input v-model="input"  prefix-icon="el-icon-date" clearable  placeholder="请输入内容"></el-input>

            <el-input ref="demo" v-model="input"  prefix-icon="el-icon-date" clearable  placeholder="请输入内容">
                <i v-slot:suffix class="el-input__icon el-icon-date"></i>
            </el-input>
        </el-row>
        
    </div>
</body>
<script>

    var app = new Vue({
        el: "#app",
        data: {
            input:"",
            pwd:"",
        },
        methods: {
            changeHandler(bool){
                console.log("change了",bool);
            }
        },
        mounted() {
            // 组件的方法 -> 先对应ref名获取组件 -> 在通过组件调用方法
            this.$refs.demo.focus();
        },
    })



</script>

</html>